package com.ruoyi.project.erp.controller;

import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.erp.vo.ContactsUserVO;
import com.ruoyi.project.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/ognizational")
public class ContactsController {
    @Autowired
    ISysUserService userService;
    @GetMapping("/getAllUser")
    public AjaxResult getAllUser(){
        List<ContactsUserVO> contactsUserVOList  = userService.getAllUser();
        return AjaxResult.success(contactsUserVOList);
    }

    @GetMapping("/getProjectUser")
    public AjaxResult getProjectUser(@RequestParam("projectId") String projectId){
        List<ContactsUserVO> contactsUserVOList  = userService.getProjectUser(projectId);
        return AjaxResult.success(contactsUserVOList);
    }



    @GetMapping("/getUserDept")
    public AjaxResult getUserDept(){
        return AjaxResult.success(userService.getUserDeptTree());
    }
}
